/*
 * SaarhApp.java
 *
 * Created on 16 de agosto de 2011, 13:11
 */
 
package com.saarh;           

import com.invient.vaadin.charts.Color;
import com.invient.vaadin.charts.InvientCharts;
import com.invient.vaadin.charts.InvientCharts.DecimalPoint;
import com.invient.vaadin.charts.InvientCharts.SeriesType;
import com.invient.vaadin.charts.InvientCharts.XYSeries;
import com.invient.vaadin.charts.InvientChartsConfig;
import com.invient.vaadin.charts.InvientChartsConfig.BarConfig;
import com.invient.vaadin.charts.InvientChartsConfig.DataLabel;
import com.saarh.interfaz.demo.Demo1;
import com.saarh.interfaz.demo.Uploader;
import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.data.*;
/** 
 *
 * @author Soma
 * @version 
 */

public class SaarhApp extends Application  {

    
    private Demo1 d1;
    
    @Override
    public void init() {
	Window mainWindow = new Window("SaarhApp");
        
        mainWindow.setContent(new Uploader());
          
	this.setMainWindow(mainWindow);
    }

    public Component getG1(){
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.BAR);
        
        BarConfig barCfg = new BarConfig();
        barCfg.setDataLabel(new DataLabel());
        barCfg.setColor(new Color.RGB(0, 255, 0));
        XYSeries seriesData = new XYSeries("Test", SeriesType.BAR, barCfg);
        seriesData.addPoint(new DecimalPoint(seriesData, 107));
        
        
        InvientCharts chart = new InvientCharts(chartConfig);
                      chart.setWidth("100%");
        chart.addSeries(seriesData);
        return chart;
    }
    
    public Component getG2(){
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.BAR);
        
        BarConfig barCfg = new BarConfig();
        barCfg.setDataLabel(new DataLabel());
        barCfg.setColor(new Color.RGB(0, 255, 0));
        XYSeries seriesData = new XYSeries("Test", SeriesType.BAR, barCfg);
        seriesData.addPoint(new DecimalPoint(seriesData, 107));
        
        
        InvientCharts chart = new InvientCharts(chartConfig);
        chart.addSeries(seriesData);
        return chart;
    }
}


